Battery operated systems require accurate measurement of current flowing into and out of the system during charging and discharging of the battery. FIG. 1 shows an example of a battery monitoring system or fuel gauge system. Battery current flows between a system node VSYS and a battery terminal VBATT through a main transistor (e.g., a transistor BATFET). One technique for measuring the battery current is to use replica devices (e.g., replica transistors Replica1 and Replica2) in parallel with the main transistor BATFET. The replica transistors Replica1 and Replica2 produce replica currents (e.g., a charging current ICHARGE and a discharge current IDISCHARGE) that are a scaled down version of the battery current. The charging current ICHARGE and the discharge current IDISCHARGE flow through sensing resistors R1 and R2, respectively. An analog to digital converter (ADC) samples the voltage across resistors R1 and R2 to determine the charge across the battery. The battery monitoring system then uses the output of the ADC to monitor the battery.
For accuracy, it is important to control the voltage across control transistors M1 and M2 for the replica device. The system may use a feedback loop to control the voltage. For example, amplifiers AMP1 and AMP2 control the voltage across control transistors M1 and M2, respectively. In this case, the inputs of amplifier AMP1 are coupled to the system node VSYS and the gate and source of replica transistor Replica2 and the output is coupled to a control transistor M1. Also, the inputs of amplifier AMP2 are coupled to the system node VBATT and the drain of replica transistor Replica1 and the output is coupled to a control transistor M2. Amplifiers AMP1 and AMP2 control the voltage at the gate of control transistors M1 and M2, respectively, to produce the replica currents. One problem with this approach is that offset error within each amplifier may cause errors in the replica currents. Also, the resistor used to measure the voltage can cause errors across process and temperature variations.